package module

import (
	"fmt"
	"gitee.com/liumou_site/gf"
)

func FileExist() (string, error) {
	var fl []string
	fn := gf.NewFile("")
	fl = append(fl, "/etc/hosts")
	fl = append(fl, "c:\\windows\\system32\\drivers\\etc\\hosts")
	fl = append(fl, "hosts")
	for _, f := range fl {
		fn.FileName = f
		fn.IsFile()
		if fn.IsFiles {
			return f, nil
		}
	}
	return "", fmt.Errorf("hosts file not found")
}
